var user = getUserInfo();

if (!user) {
    window.confirm("没有登录, 不允许进来");
}

var vue = new Vue({
    el: "#app",
    data: {
        owner: {},
        visitors: [

        ],
        totalView: 200,
        todayView: 20
    },
    methods: {},
    filters: {},
    mounted: function () {
        var param = getParams();
        //查询指定id用户对象, 如果没有自己写接口, id是用户id(不一定是当前用户)
        ajaxGet("/users/get", {id: param.ownerId}, function (data) {
            vue.owner = data.data;
            console.log(owner)
        });
        ajaxGet("/personal/getVisitors", {uid: param.ownerId}, function (data) {
            vue.visitors = data.data;
            // vue.totalView = data.data.size;
        });
        ajaxGet("/personal/visit", {vid: param.ownerId, uid: user.id}, function (data) {
            // console.log(data);//只是用户触发后端的数据添加操作
        });
        ajaxGet("/personal/totalView", {vid: param.ownerId, uid: user.id}, function (data) {
            vue.totalView = data.data;
        });
        ajaxGet("/personal/todayView", {vid: param.ownerId, uid: user.id}, function (data) {
            vue.todayView = data.data;
        });
    }
});